<table class="rails_db_data_table <%= rails_db_table_style(:table, style) %>">

  <% if header %>
    <thead class="<%= rails_db_table_style(:thead, style) %>">
      <tr class="<%= rails_db_table_style(:tr, style) %>">
        <% table.columns.each do |column| %>
          <th class="<%= rails_db_table_style(:th, style) %>"><%= column %></th>
        <% end %>
      </tr>
    </thead>
  <% end %>

  <tbody class="<%= rails_db_table_style(:tbody, style) %>">
    <% table.data.each do |record| %>
      <tr class="<%= rails_db_table_style(:tr, style)%>">
        <% table.columns.each do |column| %>
          <td class="<%= rails_db_table_style(:td, style)%>"><%= record[column.to_s] %></td>
        <% end %>
      </tr>
    <% end %>
  </tbody>

  <% if footer %>
    <tfoot class="<%= rails_db_table_style(:tfoot, style)%>">
      <tr class="<%= rails_db_table_style(:tr, style)%>">
        <% table.columns.each do |column| %>
          <th class="<%= rails_db_table_style(:th, style)%>"><%= column %></th>
        <% end %>
      </tr>
    </tfoot>
  <% end %>
</table>